.note-detail-wrapper {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding-top: 0;
}

.note-detail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  transition: all 0.3s ease-in-out;

  div[data-contents] {
    padding-bottom: 20px;
  }
}

.note-detail-preview {
  overflow: auto;
}

.note-detail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex: 1;

  .logo {
    width: 140px;
    height: 140px;
    opacity: 0.2;

    path {
      fill: $studio-gray-50;
    }
  }

  @media only screen and (max-width: $single-column) {
    display: none; // prevents flicker when closing note
  }
}

.note-detail-textarea,
.note-detail-markdown {
  width: 100%;
  height: 100%;
  border: 0;
  line-height: 1.5em;
  font-size: 16px;
  color: $studio-gray-60;
  background: $studio-white;
  resize: none;
  -webkit-tap-highlight-color: transparent;
  word-break: break-word;

  &:focus {
    outline: none;
  }
}

.note-detail-textarea {
  min-height: 100%;
  cursor: text;

  div,
  span {
    cursor: inherit;
  }

  .checkbox {
    cursor: pointer;
  }
}

.note-detail-markdown {
  overflow: visible;
  -webkit-overflow-scrolling: touch;

  p {
    margin: 0 0 1.5em;
    unicode-bidi: plaintext;
  }

  ul p {
    margin: 0;
  }

  a {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  img {
    max-width: 100%;
    height: auto;
  }
}

.note-detail-markdown {
  @import '../node_modules/highlight.js/scss/solarized-light.scss';

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    line-height: 1.15;
  }

  h1 {
    font-weight: $light;
  }

  h5,
  h6 {
    text-transform: uppercase;
  }

  hr {
    border: 0;
    border-top: 1px solid $studio-gray-5;
  }

  a {
    cursor: pointer;
  }

  blockquote {
    font-style: italic;
    border-left: 4px solid $studio-gray-5;
    margin-left: 0;
    padding-left: 1em;
  }

  $ul-padding-left: 1.4em;

  ul {
    padding-left: $ul-padding-left;
  }

  // Remove unneeded margin on root-level tasklist items
  & > ul > .task-list-item {
    margin-left: -#{$ul-padding-left};
  }

  .task-list-item {
    // It's good to have immediate CSS feedback on click since
    // there will be a slight delay until the checkbox actually toggles
    &:active {
      input {
        transform: scale(0.9);
      }
    }

    input {
      position: relative;
      bottom: 0.0625em;
      margin-right: 4px;
      height: 1em;
      vertical-align: middle;
    }
  }

  pre {
    border: 1px solid $studio-gray-20;
    padding: 1em;
    border-radius: $border-radius;
    font-size: 85%;
  }

  table {
    border-collapse: collapse;
    border-spacing: 0;
    display: block;
    width: 100%;

    tr:nth-child(2n) {
      background-color: $studio-gray-5;
    }

    th,
    td {
      border: 1px solid $studio-gray-20;
      padding: 6px 13px;
    }

    th {
      font-weight: 600;
    }
  }

  kbd {
    display: inline-block;
    padding: 3px 4px;
    line-height: 100%;
    color: #444d56;
    vertical-align: middle;
    background-color: #fafbfc;
    border: solid 1px #c6cbd1;
    border-bottom-color: #959da5;
    border-radius: 3px;
    box-shadow: inset 0 0 0 #959da5;
  }
}

.monaco-editor.monaco-editor .detected-link {
  text-underline-position: initial;
}
